<script>
export default {
  onLaunch: function () {
    console.log('App Launch')
    const updateManager = uni.getUpdateManager()
    updateManager.onCheckForUpdate(function (res) {
      // 请求完新版本信息的回调
      console.log(res.hasUpdate);
    })
    updateManager.onUpdateReady(function (res) {
      uni.showModal({
        title: '更新提示',
        content: '新版本已经准备好，是否重启应用？',
        success(res) {
          if (res.confirm) {
            // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
            updateManager.applyUpdate()
          }
        }
      })
    })
    updateManager.onUpdateFailed(function (res) {
      // 新的版本下载失败
      console.log('版本更新失败')
    })
  },
  onShow: function () {
    console.log('App Show')
  },
  onHide: function () {
    console.log('App Hide')
  },
}
</script>

<style lang="scss">
@import 'nutui-uniapp/styles/index';
/*每个页面公共css */

.nut-cell__title{
  min-width: auto !important;
}
.nut-collapse__item-wrapper__content{padding: 10px 15px!important;}
.nut-collapse-item .nut-collapse-item__title{background: #fafafa!important;border-bottom: 1px solid #f2f2f2;}
.nut-avatar image{border-radius: 10px;}
.loading-box{width: 100%;height: 300px;display: flex;justify-content: center;align-items: center;}
.fullscreen-sign{width: 100vw;height: 100vh;position: fixed;left: 0;top: 0;z-index: 9999;background: #fff;}
.fullscreen-sign .btn{position: absolute;bottom: 50px; left: 30px;transform: rotate(90deg);}
.fullscreen-sign .spcanvas{height: calc(100vh - 150px); width: 100vw;}
.fullscreen-sign .nut-signature .nut-button--default{position: absolute;bottom: 50px;right: 50px;transform: rotate(90deg);}
.fullscreen-sign .nut-signature .nut-button--primary{position: absolute;bottom: 50px;right: 100px;transform: rotate(90deg);}
.fullscreen-canvas{width: calc(100vh - 150px);height: 100vw;position: absolute;left: -9999px;}

//.nut-collapse__item-wrapper__content .nut-row{border-top: 1px solid #aaa;}
</style>
